<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>导航栏</title>
    <link rel="stylesheet" type="text/css" href="__STATIC__/newcj/css/themes.css?v=2017129">
    <link rel="stylesheet" type="text/css" href="__STATIC__/newcj/css/h5app.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/newcj/fonts/iconfont.css?v=2016070717">
    <script src="__STATIC__/newcj/js/jquery.min.js"></script>
    <script src="__STATIC__/newcj/js/dist/flexible/flexible_css.debug.js"></script>
    <script src="__STATIC__/newcj/js/dist/flexible/flexible.debug.js"></script>
</head>
<body>

<script>

    var API_URL = "http://api.tp6.com/communication/";
    var fromid ={$fromid};
    var no_read;
    ws =  new WebSocket("ws://127.0.0.1:8282");
    ws.onmessage=function(e){
        var message = eval("("+ e.data+")");

        switch (message.type){
            case  "init":
                var bild = '{"type":"bind","fromid":"'+fromid+'"}';
                ws.send(bild);
                getonread()
                return;
            case "text":
                getonread()
                return;
            case "say_img":
                getonread()
                return;



        }
    }

    function getonread(){
        $.post(
            API_URL+"getOnRead",
            {"fromid":fromid},
            function(){

            },'json'
        )
    }

</script>

</body>
</html>